package workspace;

import java.util.Scanner;

public class test20 {
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        int m = scanner.nextInt();
        int n = scanner.nextInt();
        //最大公约数
        //最小公倍数
        int small = m<n?m:n;
        for (int i = small; i >= 1 ; i--) {
            if(m % i == 0 && n % i == 0){
                System.out.println(i+" "+(i*(m/i)*(n/i)));
                break;
            }
        }
    }
}
